package com.bupt.basic;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;
import java.util.UUID;

@EqualsAndHashCode
@Data
public class Port implements Serializable {
    private static final long serialVersionUID = -7203288831221037204L;
    private String id;//端口ID
    private IBasicNetWork.BasicNode belongsNode;//端口所属节点
    private IBasicNetWork.BasicNode belongsLink;//端口所属链路
    private String rate;//端口速率：
    private String layer;//端口技术类型
    private String statue;//端口状态
    private String type;//端口类型
    //用于资源分配
    private String grand;//WDM/OTN端口 对应链路的波道序号
    private int free;//端口剩余资源
    private List<DemandReportService> carriedTraffic;//承载业务
    public Port(String id , String layer){
        this.id = id;
        this.layer = layer;
    }
    public Port(String layer){
        this.id = UUID.randomUUID().toString().replace("-","");
        this.layer = layer;
    }

    public boolean addTraffic(DemandReportService traffic){
        return carriedTraffic.add(traffic);
    }


}
